<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\shop_showlist.html";i:1535355820;s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\common_header.html";i:1534901852;s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\common_footer.html";i:1534140541;}*/ ?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__HLIB__html5shiv.js"></script>
<script type="text/javascript" src="__HLIB__respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__HLIB__Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="__HLIB__DD_belatedPNG_0.0.8a-min.js" ></script>

<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style>
    #edui1_bottombar{
        display: none;
    }
</style>
    <title>商户列表</title>
    <style>
        .red{
            background: rosybrown;
        }
    </style>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商户管理 <span class="c-gray en">&gt;</span>商户列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href='javascript:location.replace(location.href="<?php echo Url('showlist'); ?>");' title="刷新" >
    <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
        <!--<a href="javascript:;" onclick="delectCheck('<?php echo url('del'); ?>',$('.item'))" class="btn btn-danger radius">-->
            <!--<i class="Hui-iconfont">&#xe6e2;</i> 批量删除-->
            <!--</a>-->
        <a href="javascript:;" onclick="layer_show('添加商户','<?php echo url('showadd'); ?>', '550','350')" class="btn btn-primary radius">
            <i class="Hui-iconfont">&#xe600;</i> 添加商户
        </a>
            <!--<a href="?del=1" class="btn btn-warning radius"><i class="Hui-iconfont">&#xe6e2;</i>  回收站</a>-->
        </span>
        <div style="float: right">
            <!--<label>真实姓名/昵称：</label>-->
            <span  style="margin-left:14px;" class="text-c">
            <label>商户经营类别：</label>
            <span class="select-box inline">
                    <select id="reviewed" class="select "  style="width: 180px" onchange="reload()">
                        <option value=""  >&nbsp;&nbsp;|——全部</option>
                       <?php $_result=getlists('classify');if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                              <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == \think\Request::instance()->get('classify_id')): ?> selected<?php endif; ?>>&nbsp;&nbsp;|——<?php echo $v['classify_name']; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </span>
            </span>
            <input type="text" class="input-text" style="width:250px" placeholder="请输入商户联系人/联系电话/账号" id="keywords" value="<?php echo \think\Request::instance()->get('keyword'); ?>">
            <button type="button" class="btn btn-success" onclick="reload($('#keywords').val())"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="15">商户列表</th>

            </tr>
            <tr class="text-c">
                <!-- <th width="25"><input type="checkbox" name="" value=""></th>-->
                <th width="40">ID</th>
                <th width="40">商户logo</th>
                <th width="60">商户账号</th>
                <th width="80">商户名称</th>
                <th width="120">商户经营类别</th>
                <th width="50">联系人</th>
                <th width="50">联系电话</th>
                <th width="80">商户订单总额度</th>
                <th width="80">是否推荐</th>
                <th width="80">置顶状态</th>
                <th width="80">商户运营状态</th>
                <th width="100">入住时间</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>

            <tr class="text-c   ">
                <!-- <td><input type="checkbox" value="<?php echo $v->id; ?>" name="" class="item"></td>-->
                <td><?php echo $v->id; ?></td>
                <td>
                    <?php if($v->shop_logo): ?>
                    <img src="__UPS__<?php echo $v->shop_logo; ?>"/>
                    <?php endif; ?>
                </td>
                <td><?php echo $v->shop_username; ?></td>
                <td><?php echo $v->shop_name; ?></td>
                <td><?php echo $v->classify_names; ?></td>
                <td><?php echo $v->shop_person; ?></td>
                <td><?php echo $v->shop_tel; ?></td>
                <td>￥<?php echo $v->shop_money; ?></td>
                <td  onclick="isshow('<?php echo url('isshow',array('id'=>$v['id'],'is_show'=>$v['is_show'])); ?>',<?php echo $v['is_show']; ?>)">
                    <?php if($v['is_show'] == 1): ?>
                    <span class="btn btn-success radius">是</span>
                    <?php else: ?>
                    <span class="btn btn-danger radius" >否</span>
                    <?php endif; ?>
                </td>
                <td class="td-status"   onclick="adminstatus(<?php echo $v->id; ?>,<?php echo $v->shop_top; ?>,1)">
                    <?php if($v->shop_top == 1): ?>
                    <span class="btn btn-success radius" >已置顶</span>
                    <?php else: ?>
                    <span class="	btn btn-danger radius">未置顶</span>
                    <?php endif; ?>
                </td>
                <td class="td-status"   onclick="adminstatus(<?php echo $v->id; ?>,<?php echo $v->shop_status; ?>,2)">
                    <?php if($v->shop_status == 1): ?>
                    <span class="	btn btn-success radius" >已启用</span>
                    <?php else: ?>
                    <span class="	btn btn-danger radius" >已停用</span>
                    <?php endif; ?>
                </td>
                <td><?php echo $v->create_time; ?></td>
                <td class="td-manage">
                    <!--<a title="查看详情"  onclick="layer_show('用户详情','<?php echo url('showdetails',array('id'=>$v['id'])); ?>','800','450')" class="ml-5" style="text-decoration:none;">-->
                    <!--<i class="Hui-iconfont">&#xe725;</i>-->
                    <!--</a>-->
                    <a title="编辑" href="javascript:;" onclick="layer_show('商户编辑','<?php echo url('showEdit',array('id'=>$v['id'])); ?>','','')" class="btn btn-warning  radius" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6df;</i>
                    </a>
                    <a href="#" onclick="referpass(<?php echo $v->id; ?>)" style="text-decoration: none" class="btn btn-primary radius">
                        <i class="Hui-iconfont">&#xe63f;</i> 重置密码
                    </a>
                </td>
            </tr>
            <?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>
        <div class="page">
            <?php echo $page; ?>
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    <script type="text/javascript" src="__HLIB__jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__HLIB__layer/2.4/layer.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__HLIB__laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__HLIB__Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__HLIB__layer/2.4/layer.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__AJS__common.js"></script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="__HLIB__My97DatePicker/4.8/WdatePicker.js"></script>
    <!--/_footer 作为公共模版分离出去-->
</div>
</body>
<script>
    function reload() {
        $keyword=$('#keywords').val();
        $classify_id=$('#reviewed').val();
        goUrl('?keyword=' + $keyword+"&classify_id="+$classify_id);
    }
    /*管理员-重置密码*/
    function referpass(id){
        layer.confirm('确认要将密码重置为a123456吗？',function(index){
            $.ajax({
                type: 'POST',
                url: "<?php echo url('refresspwd'); ?>",
                data:{id:id},
                dataType: 'json',
                success: function(data){
                    layer.msg(data.msg,{icon:1,time:1000},function () {
                        location.reload();
                    });

                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
    function adminstatus(id,user_status,type) {
        if(type==1){
            if(user_status==1){
                $msg="确认将该商户取消置顶？";
            }else{
                $msg="确认将该商户置顶?";
            }
            $data={id:id,shop_top:user_status,type:1};
        }else{
            if(user_status==1){
                $msg="确认要拉黑该商户吗？";
            }else{
                $msg="确认要开启该商户吗";
            }
            $data={id:id,shop_status:user_status,type:2};
        }
        layer.confirm($msg,function(){
            $.ajax({
                type: 'POST',
                url: "<?php echo url('editstatus'); ?>",
                data:$data,
                dataType: 'json',
                success: function(data){
                    layer.msg(data.msg,{icon:1,time:1000},function () {
                        location.reload();
                    });
                },
                error:function(data) {
                    console.log(data.msg);
                }
            });
        });
    }
    function isshow(url,state) {
        var message = state==1?'您确定不推荐此商户在首页显示吗？':'您确定要推荐此商户在首页显示吗？';
        layer.confirm(message, function () {
            requestUrl(url);
        });
    }
</script>
</html>